<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    let api=new Promise((resolve,reject)=>{
        setTimeout(()=>{
            if(true){
                resolve(10000)
            }else{
                reject()
            }
        },1000)
    })

    api.then((res)=>{
        //如果没有return，包装成promise对象，
        //如果return，非promise类型 pending => fulfilled
        //如果return, promise类型 根据新的promise对象结果决定 fullfilled/rejected
        console.log('今年奖金',res)
        return res+10000
    })
    .then((res)=>{
        console.log('明年奖金',res)
    })
    .catch(()=>{
        console.log('失败')
    })
</script>
</html>